package filter;

import java.io.IOException;

public class HandlerZip extends Handler {

	HandlerZip(Filter filter) {
		super(filter);
	}
	
	@Override
	public void doCmd(String sumCmd) throws Exception {
		String[] cmds = sumCmd.split(" ");
		if(cmds.length == 2) {
			this.filtOperation.compressFile(cmds[0], cmds[1]);
		} else {
			this.cmdError();
			throw new IOException(ErrorMessage);
		}
	}

	@Override
	public void doTips() {
		System.out.println("Format : -zip [inputpath] [outputzipFile]	\n"
				+ "				to compress the file on the inputpath to zip\n"
				+ "				output to the outputzipFile\n");
	}

}
